<script type="text/javascript">
<!--
fss.needPagePublishPermission = true;

fss.loginReady(function(){
    fss.checkPermission(<?php echo ($sf_user->getUid() ?: $sf_user->getFbUser()->uid)  ?>, 'publish_stream,manage_pages', function (enabled) {
        if (enabled)
            fss.needPagePublishPermission = false;
    });
});

function postAndContinue(){
    if (fss.needPagePublishPermission)
        fss.requestPagePublishPermission(doPostAndContinue,true);
    else
        doPostAndContinue();
}

function doPostAndContinue() {
    $('#perms_button').hide();
    $('#perms_loader').show();
    $.post('<?php echo url_for('@install_step1_publish') ?>', {<?php /* Force POST */ ?>}, function (data) {
            document.location.href = '<?php echo url_for('@install_step2') ?>';
    });
}

-->
</script>
<div class="message-grey mb2" style="zoom:1">
  <strong><?php echo __("Post on the wall of my Page.") ?></strong><br />

  <div class="pt05">
    <?php echo link_to(__("Skip this step"), '@install_step2?'.sfOutputEscaper::unescape($url_params)) ?>
  </div>
</div>

<div align="center">
  <div id="perms_loader" class="loader" style="display: none"></div>
</div>

<div class="install-buttons">
  <?php echo link_to(__('Skip this step'), '@install_step2?'.sfOutputEscaper::unescape($url_params)) ?> &nbsp;&middot;&nbsp;
  <?php echo link_to_function(__('Authorize and continue'), 'postAndContinue()', array(
          'id' => 'perms_button',
          'class' => 'vtns_buttonBlue',
          )) ?>
</div>
<div class="clr"></div>
